//
//  WeiXinModel.swift
//  WeChat
//
//  Created by henaihan on 2017/10/23.
//  Copyright © 2017年 henaihan. All rights reserved.
//

import UIKit

class WeiXinModel: NSObject {
    @objc var name: NSString!
    @objc var pic: NSString!
    @objc var date: NSString!
    @objc var introduce: NSString!
    
    //通过KVC间接赋值
    init(dict: [String : AnyObject]) {
        //调用KVC的通过字典字典给对象的属性设置值
        //给 '对象' 发送 setValuesForKeysWithDictionary:
        super.init()
        self.setValuesForKeys(dict)
    }
    
//    class func weixinModelWithDict(_ dict: NSDictionary) -> WeiXinModel{
//        let model = WeiXinModel()
//        //kvc根据字典,自动进行模型的初始化
//        model.setValuesForKeys(dict as! [String : NSObject])
//        return model
//    }
}
